package com.tch.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.lang.model.SourceVersion;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.Map;

@Controller
public class FreemarkerController {
    @RequestMapping("/freemarkerIndex1")
    public String freemarkerIndex1(Map<String, Object> result, HttpServletRequest http) {
        result.put("name", "张康");
        result.put("sex", "0");
        result.put("age",22);

        ArrayList<String> objects = new ArrayList<>();
        objects.add("Addlist01");
        objects.add("Addlist02");

        result.put("arrayList",objects);

        System.out.println("result = " + result);
        return "freemarkerindex";
    }
}
